package cn.ithers.blog.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name = "tb_article")
public class ArticleNoAll implements Serializable {


    @ApiModelProperty(value = "文章ID")
    @Id
    private String id;

    @ApiModelProperty(value = "文章标题")
    @Column(name = "title")
    private String title;


    @ApiModelProperty(value = "用户ID")
    @Column(name = "user_id")
    private String userId;

    @ApiModelProperty(value = "用户头像")
    @Column(name = "user_avatar")
    private String userAvatar;

    @ApiModelProperty(value = "用户名")
    @Column(name = "user_name")
    private String userName;

    @ApiModelProperty(value = "分类ID")
    @Column(name = "category_id")
    private String categoryId;

    @ApiModelProperty(value = "文章类型（0表示富文本，1表示markdown）")
    @Column(name = "type")
    private String type;

    @ApiModelProperty(value = "封面")
    @Column(name = "cover")
    private String cover;

    @ApiModelProperty(value = "状态（0表示删除，1表示已经发布，2表示草稿，3.表示置顶）")
    @Column(name = "state")
    private String state = "1";

    @ApiModelProperty(value = "摘要")
    @Column(name = "summary")
    private String summary;

    @ApiModelProperty(value = "标签")
    @Column(name = "labels")
    private String labels;

    @ApiModelProperty(value = "阅读数量")
    @Column(name = "view_count")
    private long viewCount = 0L;

    @ApiModelProperty(value = "发布时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "update_time")
    private Date updateTime;

}
